package com.czh.seckill.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

//mvc配置类
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Autowired
    private UserArgumentResolver userArgumentResolver;

    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) {
        resolvers.add(userArgumentResolver);
        //WebMvcConfigurer.super.addArgumentResolvers(resolvers);
    }

//    @Override
//    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//        // 添加文档对应的映射
//        registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
//        registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
//        // 添加对应的映射
//        registry.addResourceHandler("/qy/**").addResourceLocations("classpath:/static/qy/");
//        super.addResourceHandlers(registry);
//        WebMvcConfigurer.super.addResourceHandlers(registry);
//    }
}
